package com.tiamo.chatgpt.rest;

import com.tiamo.chatgpt.domain.message.MsgDto;
import com.tiamo.chatgpt.domain.message.SendReqDto;
import com.tiamo.chatgpt.service.MessageService;
import com.tiamo.common.web.controller.BaseController;
import com.tiamo.common.web.response.WebResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author luozhiwei
 * @date 2023/6/3 下午6:50
 */
@RestController
@Api(tags = "消息")
@RequestMapping("/message")
public class MessageController implements BaseController {

    @Resource
    private MessageService messageService;

    @ApiOperation("发送")
    @PostMapping("/send")
    public WebResponse<List<MsgDto>> send(@RequestBody SendReqDto dto) {
        return ok(messageService.send(dto));
    }
}
